package com.yq.socket1.day1.v3;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author 3307235355@qq.com
 * @description
 * @since 2022/07/01 10:20
 */
public class Client {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1", 8888);

        Student student = new Student("张三", 20);

        OutputStream out = socket.getOutputStream();

        ObjectOutputStream ob = new ObjectOutputStream(out);
        ob.writeObject(student);

        socket.close();

    }
}
